package com.xxx.client.android.api.impl;

import java.util.List;

import org.ksoap2.serialization.SoapObject;

import com.xxx.client.android.api.MarqueeListEntry;
import com.xxx.client.android.api.MarqueeVO;

public class MarqueeVOFunctions {

	public static MarqueeVO getMarqueeVO(SoapObject soapObject)
			throws RuntimeException {
		return new MarqueeVOBuilder().build(soapObject);
	}

	public static MarqueeListEntry getMarqueeVOList(Object respone)
			throws RuntimeException {
		if (respone != null) {
			@SuppressWarnings("unchecked")
			List<SoapObject> soapList = (List<SoapObject>) respone;
			MarqueeListEntry list = new MarqueeListEntry(soapList.size());
			for (SoapObject soapObject : soapList) {
				list.addMarquee(getMarqueeVO(soapObject));
			}

			return list;
		}
		return null;
	}
}
